home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / MacTCP Library 1.1 / UDP⁄TCP Probe ƒ / README < prev    next >
Encoding:
Text File  |  1995-12-04  |  3.6 KB  |  77 lines  |  [TEXT/SPM ]

  1.  
  2. UDP Probe
  3.  
  4.   Mac Application to send UDP datagrams and to look for responses.
  5.   
  6.   This is loosely based on code by Olaf Titz (udpprobe) which does the same
  7.   thing but on the unix side of things.
  8.   
  9.   I needed a small application to test my TCP library, and this just
  10.   happened to fit the bill.  It is especially nice because it will
  11.   test the udp side of the library (very little sample code exists
  12.   for working with udp connections).
  13.   
  14.   Hope you like it...
  15.   
  16.   Dave Nebinger
  17.   dnebing@epix.net
  18.   
  19. P.S.
  20.     UDP Probe originally started out using just UDP for probing the host.  However, I also wanted
  21.     to check the TCP side of my MacTCP library, so I decided to add TCP probing facilities to the
  22.     UDP Probe application.
  23.     
  24.     So I started adding the TCP code, basically using a cut-n-paste approach from the UDP code
  25.     and replacing UDP with TCP.  Everything looked good until I tried to execute the application.
  26.     For some reason, I couldn't receive any replies because I would get the message that the
  27.     host had closed the connection.
  28.     
  29.     Meanwhile, that would really confuse my application and crash it, leaving the open TCP stream
  30.     out there to wreak havoc on my mac as soon as I tried to open a new application.  So I went
  31.     back to the TCP library and added logic from DTS's ZapTCP so the library could clean itself
  32.     up when it crashed.  That saved me alot of resets...
  33.     
  34.     Anyway, to make a long debugging story short, after a day of wanting to rip out my hair I realized
  35.     that in copying UDP code and replacing it with TCP code, I had kept the code to send data to the
  36.     host.  I finally realized that the host daemons didn't know why I would be sending them information,
  37.     especially since they were just supposed to send information (I was testing using the DayTime
  38.     daemon), so they would close the connection and leave me hanging.  The moral of the story is
  39.     that not all TCP daemons work like UDP daemons.
  40.     
  41.     In the end it works like this: you must know what kind of daemon you are probing.  If it is something
  42.     like the DayTime daemon, you should clear all of the information from the 'Send:' portion of the
  43.     Probe dialog.  If you are probing a daemon like the Echo daemon, then you should put something
  44.     in there.
  45.     
  46.     Dave.
  47.     
  48. [Original README follows below...]
  49.  
  50. udpprobe - send a UDP datagram and look for response, version 1.1
  51.  
  52. This program sends a UDP datagram to a specified port and optionally
  53. waits for response.  It is intended mainly for testing and signaling
  54. purposes.  You can use it on the echo or daytime port (cf.
  55. /etc/services and /etc/inetd.conf) to test if your network is alive
  56. and the UDP modules of specific hosts are working.  You can also use it
  57. for signaling: configure inetd to start a specific program whenever it
  58. receives a packet on a special port.  This way you can configure a
  59. system with a mail server and clients that are not always running, so
  60. that the mailer is told from a client by sending a UDP packet (i.e.
  61. an "I am here" message) to deliver mail, and similar things.
  62.  
  63. I have written this program on Linux 0.99.14 and tested it on Ultrix
  64. 4.3 and HPUX 8.07 as well.  It should run on any system that has
  65. reasonably BSD-compatible networking and getopts(3) (not really needed
  66. but I'm  lazy :-).  Perhaps you need to tune the header includes a
  67. bit.  You don't need special privileges to compile or run this program.
  68.  
  69. Note: If you're looking for a similar (but much more powerful) tool to
  70. access TCP ports, try socket(1) from the comp.sources.unix archive.
  71.  
  72. Written by Olaf Titz <olaf@bigred.ka.sub.org>
  73. This software is released into the public domain.  The author assumes
  74. no responsibility of any kind for its use.
  75.  
  76.  
  77.